﻿namespace ExamV5.LineStudyExam
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class JoinStudy : Page
    {
        protected GridView DataGridA;
        protected GridView DataGridB;
        protected GridView DataGridC;
        protected GridView DataGridD;
        protected GridView DataGridE;
        protected GridView DataGridJ;
        protected HtmlInputHidden EndTime;
        protected HtmlForm Form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        private int int_1 = 0;
        protected Label labAFen;
        protected Label labATitle;
        protected Label labBFen;
        protected Label labBTitle;
        protected Label labCFen;
        protected Label labCountWriteANY;
        protected Label labCountWriteAY;
        protected Label labCountWriteBY;
        protected Label labCountWriteCY;
        protected Label labCountWriteDY;
        protected Label labCountWriteFY;
        protected Label labCountWriteJY;
        protected Label labCountWriteSY;
        protected Label labCountWriteTY;
        protected Label labCTitle;
        protected Label labDFen;
        protected Label labDTitle;
        protected Label labEFen;
        protected Label labETitle;
        protected Label labFTitle;
        protected Label labGTitle;
        protected Label labHTitle;
        protected Label labJFen;
        protected Label labJTitle;
        protected Label labUserInfo;
        protected Label labWriteANY;
        protected Label labWriteAY;
        protected Label labWriteBY;
        protected Label labWriteCY;
        protected Label labWriteDY;
        protected Label labWriteFY;
        protected Label labWriteJY;
        protected Label labWriteSY;
        protected Label labWriteTY;
        private PublicFun publicFun_0 = new PublicFun();
        protected HtmlInputHidden StartTime;
        private string string_0 = "";
        private string string_1 = "";
        private string string_2 = "";
        private string string_3 = "";
        private string string_4 = "";
        private string string_5 = "";
        private string string_6 = "";
        protected HtmlInputHidden SumTime;
        protected HtmlInputHidden txtCheckID;
        protected HtmlInputHidden txtHideComm;
        protected HtmlInputHidden txtHideEnter;

        private void method_0()
        {
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand(string.Concat(new object[] { "select * from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            if (reader.Read())
            {
                this.labCountWriteSY.Text = reader["RubricCountYS"].ToString();
                this.labCountWriteDY.Text = reader["RubricCountYD"].ToString();
                this.labCountWriteBY.Text = reader["RubricCountYB"].ToString();
                this.labCountWriteFY.Text = reader["RubricCountYF"].ToString();
                this.labCountWriteCY.Text = reader["RubricCountYC"].ToString();
                this.labCountWriteAY.Text = reader["RubricCountYA"].ToString();
                this.labCountWriteJY.Text = reader["RubricCountYJ"].ToString();
                this.labCountWriteTY.Text = reader["RubricCountYT"].ToString();
                this.labCountWriteANY.Text = reader["RubricCountYAN"].ToString();
                this.ViewState["CountNS"] = reader["RubricCountNS"].ToString();
                this.ViewState["CountND"] = reader["RubricCountND"].ToString();
                this.ViewState["CountNB"] = reader["RubricCountNB"].ToString();
                this.ViewState["CountNF"] = reader["RubricCountNF"].ToString();
                this.ViewState["CountNC"] = reader["RubricCountNC"].ToString();
                this.ViewState["CountNA"] = reader["RubricCountNA"].ToString();
                this.ViewState["CountNJ"] = reader["RubricCountNJ"].ToString();
                this.ViewState["CountNT"] = reader["RubricCountNT"].ToString();
                this.ViewState["CountNAN"] = reader["RubricCountNAN"].ToString();
                this.labWriteSY.Text = reader["RubricYS"].ToString();
                this.labWriteDY.Text = reader["RubricYD"].ToString();
                this.labWriteBY.Text = reader["RubricYB"].ToString();
                this.labWriteFY.Text = reader["RubricYF"].ToString();
                this.labWriteCY.Text = reader["RubricYC"].ToString();
                this.labWriteAY.Text = reader["RubricYA"].ToString();
                this.labWriteJY.Text = reader["RubricYJ"].ToString();
                this.labWriteTY.Text = reader["RubricYT"].ToString();
                this.labWriteANY.Text = reader["RubricYAN"].ToString();
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
        }

        private void method_1()
        {
            int num = 0;
            string cmdText = "select ParmName from SysParmInfo where ParmMemo='RubricType' and ParmValue<>'I' order by ParmValue";
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand(cmdText, connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            while (reader.Read())
            {
                switch (num)
                {
                    case 0:
                        this.labATitle.Text = reader["ParmName"].ToString();
                        break;

                    case 1:
                        this.labBTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 2:
                        this.labCTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 3:
                        this.labDTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 4:
                        this.labETitle.Text = reader["ParmName"].ToString();
                        break;

                    case 5:
                        this.labFTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 6:
                        this.labGTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 7:
                        this.labHTitle.Text = reader["ParmName"].ToString();
                        break;

                    case 9:
                        this.labJTitle.Text = reader["ParmName"].ToString();
                        break;
                }
                num++;
            }
            if (this.labATitle.Text.Trim() == "")
            {
                this.labATitle.Text = "单选题";
            }
            if (this.labBTitle.Text.Trim() == "")
            {
                this.labBTitle.Text = "多选题";
            }
            if (this.labCTitle.Text.Trim() == "")
            {
                this.labCTitle.Text = "判断题";
            }
            if (this.labDTitle.Text.Trim() == "")
            {
                this.labDTitle.Text = "填空题";
            }
            if (this.labETitle.Text.Trim() == "")
            {
                this.labETitle.Text = "简答题";
            }
            if (this.labFTitle.Text.Trim() == "")
            {
                this.labFTitle.Text = "作文题";
            }
            if (this.labGTitle.Text.Trim() == "")
            {
                this.labGTitle.Text = "论述题";
            }
            if (this.labHTitle.Text.Trim() == "")
            {
                this.labHTitle.Text = "分析题";
            }
            if (this.labJTitle.Text.Trim() == "")
            {
                this.labJTitle.Text = "综合题";
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
        }

        private void method_10()
        {
            this.int_0 = 0;
            this.string_0 = "";
            this.string_1 = "";
            int num = 0;
            while (true)
            {
                if (num >= this.DataGridA.Rows.Count)
                {
                    break;
                }
                try
                {
                    Label label = (Label) this.DataGridA.Rows[num].FindControl("labAOKAnswer");
                    label.Text = label.Text.Replace("<BR>", "").Replace("<br>", "").Replace("&nbsp;", "").ToUpper();
                    Label label2 = (Label) this.DataGridA.Rows[num].FindControl("labAOKAnswerTip");
                    Label label3 = (Label) this.DataGridA.Rows[num].FindControl("labAID");
                    RadioButtonList list = (RadioButtonList) this.DataGridA.Rows[num].FindControl("RBLAData");
                    Image image = (Image) this.DataGridA.Rows[num].FindControl("ImgOKAnswerS");
                    image.Visible = true;
                    list.Visible = true;
                    if (list.Visible)
                    {
                        if (list.SelectedIndex == -1)
                        {
                            this.string_0 = this.string_0 + label3.Text.Trim() + ",";
                            image.ImageUrl = "../image/WriteN.gif";
                        }
                        else
                        {
                            if (!(label.Text.Trim() == list.SelectedItem.Value.Trim()))
                            {
                                this.string_0 = this.string_0 + label3.Text.Trim() + ",";
                                image.ImageUrl = "../image/WriteN.gif";
                            }
                            else
                            {
                                this.string_1 = this.string_1 + label3.Text.Trim() + ",";
                                image.ImageUrl = "../image/WriteY.gif";
                                this.int_0++;
                            }
                            this.ViewState["LastWriteN"] = this.ViewState["LastWriteN"].ToString().Replace(label3.Text.Trim() + ",", "");
                            list.Enabled = false;
                            label2.Visible = true;
                            label2.Text = "<font color=red>正确答案为：" + label.Text + "</font>";
                            Label label4 = (Label) this.DataGridA.Rows[num].FindControl("labAOKMemo");
                            if (label4.Text.Replace("&nbsp;", "").Trim() != "")
                            {
                                label4.Visible = true;
                                label4.Text = "<font color=red>答案说明：</font>" + label4.Text;
                            }
                        }
                    }
                }
                catch
                {
                }
                num++;
            }
            this.ViewState["UserWriteN"] = this.string_0;
        }

        private void method_11()
        {
            this.int_0 = 0;
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridB.Rows.Count; i++)
            {
                string str = "";
                Label label = (Label) this.DataGridB.Rows[i].FindControl("labBID");
                Label label4 = (Label) this.DataGridB.Rows[i].FindControl("labBOKAnswer");
                label4.Text = label4.Text.Replace("<BR>", "").Replace("<br>", "").Replace("&nbsp;", "").ToUpper();
                Label label3 = (Label) this.DataGridB.Rows[i].FindControl("labBOKAnswerTip");
                CheckBoxList list = (CheckBoxList) this.DataGridB.Rows[i].FindControl("CBLBData");
                Image image = (Image) this.DataGridB.Rows[i].FindControl("ImgOKAnswerD");
                image.Visible = true;
                list.Visible = true;
                if (list.Visible)
                {
                    for (int j = 0; j < list.Items.Count; j++)
                    {
                        if (list.Items[j].Selected)
                        {
                            switch (j)
                            {
                                case 0:
                                    str = str + "A#";
                                    break;

                                case 1:
                                    str = str + "B#";
                                    break;

                                case 2:
                                    str = str + "C#";
                                    break;

                                case 3:
                                    str = str + "D#";
                                    break;

                                case 4:
                                    str = str + "E#";
                                    break;

                                case 5:
                                    str = str + "F#";
                                    break;
                            }
                        }
                    }
                    if (str.Length > 0)
                    {
                        str = str.Substring(0, str.Length - 1);
                        if (label4.Text.Trim() == str.Trim())
                        {
                            this.string_1 = this.string_1 + label.Text.Trim() + ",";
                            image.ImageUrl = "../image/WriteY.gif";
                            this.int_0++;
                        }
                        else
                        {
                            this.string_0 = this.string_0 + label.Text.Trim() + ",";
                            image.ImageUrl = "../image/WriteN.gif";
                        }
                        this.ViewState["LastWriteN"] = this.ViewState["LastWriteN"].ToString().Replace(label.Text.Trim() + ",", "");
                        label3.Visible = true;
                        label3.Text = "<font color=red>正确答案为：" + label4.Text.Replace('#', '、') + "</font>";
                        Label label2 = (Label) this.DataGridB.Rows[i].FindControl("labBOKMemo");
                        if (label2.Text.Replace("&nbsp;", "").Trim() != "")
                        {
                            label2.Visible = true;
                            label2.Text = "<font color=red>答案说明：</font>" + label2.Text;
                        }
                    }
                    else
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                        image.ImageUrl = "../image/WriteN.gif";
                    }
                }
            }
            this.ViewState["UserWriteN"] = this.string_0;
        }

        private void method_12()
        {
            this.int_0 = 0;
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridC.Rows.Count; i++)
            {
                Label label4 = (Label) this.DataGridC.Rows[i].FindControl("labCOKAnswer");
                Label label3 = (Label) this.DataGridC.Rows[i].FindControl("labCOKAnswerTip");
                Label label = (Label) this.DataGridC.Rows[i].FindControl("labCID");
                RadioButtonList list = (RadioButtonList) this.DataGridC.Rows[i].FindControl("RBLCData");
                Image image = (Image) this.DataGridC.Rows[i].FindControl("ImgOKAnswerB");
                image.Visible = true;
                list.Visible = true;
                if (list.Visible)
                {
                    if (list.SelectedIndex == -1)
                    {
                        this.string_0 = this.string_0 + label.Text.Trim() + ",";
                        image.ImageUrl = "../image/WriteN.gif";
                    }
                    else
                    {
                        if (!(label4.Text.Trim() == list.SelectedItem.Value.Trim()))
                        {
                            this.string_0 = this.string_0 + label.Text.Trim() + ",";
                            image.ImageUrl = "../image/WriteN.gif";
                        }
                        else
                        {
                            this.string_1 = this.string_1 + label.Text.Trim() + ",";
                            image.ImageUrl = "../image/WriteY.gif";
                            this.int_0++;
                        }
                        this.ViewState["LastWriteN"] = this.ViewState["LastWriteN"].ToString().Replace(label.Text.Trim() + ",", "");
                        list.Enabled = false;
                        label3.Visible = true;
                        label3.Text = "<font color=red>正确答案为：" + label4.Text.Replace("Y", "正确").Replace("N", "错误") + "</font>";
                        Label label2 = (Label) this.DataGridC.Rows[i].FindControl("labCOKMemo");
                        if (label2.Text.Replace("&nbsp;", "").Trim() != "")
                        {
                            label2.Visible = true;
                            label2.Text = "<font color=red>答案说明：</font>" + label2.Text;
                        }
                    }
                }
            }
            this.ViewState["UserWriteN"] = this.string_0;
        }

        private void method_13()
        {
            this.int_0 = 0;
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridD.Rows.Count; i++)
            {
                Label label3 = (Label) this.DataGridD.Rows[i].FindControl("labDOKAnswer");
                Label label1 = (Label) this.DataGridD.Rows[i].FindControl("labDOKAnswerTip");
                Label label2 = (Label) this.DataGridD.Rows[i].FindControl("labDID");
                Image image = (Image) this.DataGridD.Rows[i].FindControl("ImgOKAnswerF");
                image.Visible = false;
                TextBox box6 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerA");
                TextBox box5 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerB");
                TextBox box = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerC");
                TextBox box2 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerD");
                TextBox box3 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerE");
                TextBox box4 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerF");
                label3.Visible = true;
                label3.Text = "<font color=red>正确答案为：" + label3.Text.Replace("<BR>", "").Replace("<br>", "").Replace("&nbsp;", "").Replace("####", "#").Replace("###", "#").Replace("##", "#").Replace("#", "  、&nbsp;&nbsp;") + "</font>";
                if ((((!(box6.Text.Trim() == "") || !(box5.Text.Trim() == "")) || (!(box.Text.Trim() == "") || !(box2.Text.Trim() == ""))) || !(box3.Text.Trim() == "")) || !(box4.Text.Trim() == ""))
                {
                    this.string_1 = this.string_1 + label2.Text.Trim() + ",";
                }
                else
                {
                    this.string_0 = this.string_0 + label2.Text.Trim() + ",";
                }
                this.ViewState["LastWriteN"] = this.ViewState["LastWriteN"].ToString().Replace(label2.Text.Trim() + ",", "");
                Label label = (Label) this.DataGridD.Rows[i].FindControl("labDOKMemo");
                if (label.Text.Replace("&nbsp;", "").Trim() != "")
                {
                    label.Visible = true;
                    label.Text = "<font color=red>答案说明：</font>" + label.Text;
                }
            }
            this.ViewState["UserWriteN"] = this.string_0;
        }

        private void method_14()
        {
            this.int_0 = 0;
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridE.Rows.Count; i++)
            {
                Label label3 = (Label) this.DataGridE.Rows[i].FindControl("labEOKAnswer");
                Label label2 = (Label) this.DataGridE.Rows[i].FindControl("labEID");
                TextBox box = (TextBox) this.DataGridE.Rows[i].FindControl("txtEAnswer");
                label3.Visible = true;
                label3.Text = "<font color=red>正确答案为：" + label3.Text + "</font>";
                if (box.Text.Trim() == "")
                {
                    this.string_0 = this.string_0 + label2.Text.Trim() + ",";
                }
                else
                {
                    this.string_1 = this.string_1 + label2.Text.Trim() + ",";
                }
                this.ViewState["LastWriteN"] = this.ViewState["LastWriteN"].ToString().Replace(label2.Text.Trim() + ",", "");
                Label label = (Label) this.DataGridE.Rows[i].FindControl("labEOKMemo");
                if (label.Text.Replace("&nbsp;", "").Trim() != "")
                {
                    label.Visible = true;
                    label.Text = "<font color=red>答案说明：</font>" + label.Text;
                }
            }
            this.ViewState["UserWriteN"] = this.string_0;
        }

        private void method_15()
        {
            this.int_0 = 0;
            this.string_0 = "";
            this.string_1 = "";
            for (int i = 0; i < this.DataGridJ.Rows.Count; i++)
            {
                Label label3 = (Label) this.DataGridJ.Rows[i].FindControl("labJOKAnswer");
                Label label2 = (Label) this.DataGridJ.Rows[i].FindControl("labJID");
                TextBox box = (TextBox) this.DataGridJ.Rows[i].FindControl("txtJAnswer");
                label3.Visible = true;
                label3.Text = "<font color=red>正确答案为：" + label3.Text + "</font>";
                if (box.Text.Trim() == "")
                {
                    this.string_0 = this.string_0 + label2.Text.Trim() + ",";
                }
                else
                {
                    this.string_1 = this.string_1 + label2.Text.Trim() + ",";
                }
                this.ViewState["LastWriteN"] = this.ViewState["LastWriteN"].ToString().Replace(label2.Text.Trim() + ",", "");
                Label label = (Label) this.DataGridJ.Rows[i].FindControl("labJOKMemo");
                if (label.Text.Replace("&nbsp;", "").Trim() != "")
                {
                    label.Visible = true;
                    label.Text = "<font color=red>答案说明：</font>" + label.Text;
                }
            }
            this.ViewState["UserWriteN"] = this.string_0;
        }

        private void method_2()
        {
            SqlDataReader reader;
            SqlCommand command;
            SqlConnection connection;
            string str9;
            string str11;
            int num3;
            string cmdText = "";
            string str3 = "";
            string str4 = "";
            string str5 = "";
            string str6 = "";
            int num = 10;
            switch (this.string_2.Trim())
            {
                case "A":
                    cmdText = string.Concat(new object[] { "select RubricNS as RubricN,RubricCountYS as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "B":
                    cmdText = string.Concat(new object[] { "select RubricND as RubricN,RubricCountYD as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "C":
                    cmdText = string.Concat(new object[] { "select RubricNB as RubricN,RubricCountYB as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "D":
                    cmdText = string.Concat(new object[] { "select RubricNF as RubricN,RubricCountYF as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "E":
                    cmdText = string.Concat(new object[] { "select RubricNA as RubricN,RubricCountYA as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "F":
                    cmdText = string.Concat(new object[] { "select RubricNC as RubricN,RubricCountYC as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "G":
                    cmdText = string.Concat(new object[] { "select RubricNT as RubricN,RubricCountYT as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "H":
                    cmdText = string.Concat(new object[] { "select RubricNAN as RubricN,RubricCountYAN as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "J":
                    cmdText = string.Concat(new object[] { "select RubricNJ as RubricN,RubricCountYJ as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                default:
                    cmdText = string.Concat(new object[] { "select RubricNS as RubricN,RubricCountYS as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;
            }
            SqlConnection connection2 = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection2.Open();
            SqlCommand command2 = new SqlCommand(cmdText, connection2);
            SqlDataReader reader2 = command2.ExecuteReader(CommandBehavior.CloseConnection);
            if (reader2.Read())
            {
                str3 = reader2["RubricN"].ToString();
                this.ViewState["LastWriteN"] = str3;
                str4 = reader2["RubricY"].ToString();
            }
            reader2.Close();
            command2.Dispose();
            connection2.Close();
            connection2.Dispose();
            int num2 = 0;
            string str12 = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='StudyRubricSum'", "ParmValue").Trim();
            if (str12.Trim() == "")
            {
                num2 = 10;
                this.ViewState["NCount"] = 10;
            }
            else
            {
                num2 = Convert.ToInt16(str12);
                this.ViewState["NCount"] = num2;
            }
            if (str3.Trim() == "")
            {
                num = num2;
            }
            else
            {
                num = num2;
                string[] strArray2 = str3.Split(new char[] { ',' });
                for (num3 = 0; num3 < strArray2.Length; num3++)
                {
                    if ((strArray2[num3].Trim() != "") && (str5.IndexOf(strArray2[num3].Trim() + ",") == -1))
                    {
                        num--;
                        str5 = str5 + strArray2[num3].Trim() + ",";
                    }
                }
            }
            if (str4.Trim() != "")
            {
                string[] strArray = str4.Split(new char[] { ',' });
                for (num3 = 0; num3 < strArray.Length; num3++)
                {
                    if (strArray[num3].Trim() != "")
                    {
                        str6 = str6 + strArray[num3].Trim() + ",";
                    }
                }
            }
            string str10 = str5 + str6;
            if (this.string_5 == "C")
            {
                str9 = "";
                str11 = string.Concat(new object[] { "select top ", num2, " ID from RubricInfo where  Flag='B' and SubjectID=", this.int_1, " and  ISCheck='N' and IsDel='N' and RubricType='", this.string_2, "'" });
                if (this.string_4.Trim() != "Z")
                {
                    str11 = str11 + " and Difficulty='" + this.string_4 + "' ";
                }
                str10 = this.method_3();
                str11 = str11 + " and ID not in(" + str10 + ")";
                connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                connection.Open();
                command = new SqlCommand(str11, connection);
                reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                while (reader.Read())
                {
                    str9 = str9 + reader["ID"].ToString() + ",";
                }
                reader.Close();
                command.Dispose();
                connection.Close();
                connection.Dispose();
                str5 = str9;
            }
            else if (num > 0)
            {
                str9 = "";
                str11 = string.Concat(new object[] { "select top ", num, " ID from RubricInfo where  Flag='B' and SubjectID=", this.int_1, " and  ISCheck='N' and IsDel='N' and RubricType='", this.string_2, "'" });
                if (this.string_4.Trim() != "Z")
                {
                    str11 = str11 + " and Difficulty='" + this.string_4 + "' ";
                }
                if (str6.Trim() != "")
                {
                    str11 = str11 + " and ID not in(" + str10.Substring(0, str10.Length - 1) + ")";
                }
                connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                connection.Open();
                command = new SqlCommand(str11, connection);
                reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                while (reader.Read())
                {
                    str9 = str9 + reader["ID"].ToString() + ",";
                }
                reader.Close();
                command.Dispose();
                connection.Close();
                connection.Dispose();
                if (this.string_5 == "A")
                {
                    str5 = str5 ?? "";
                }
                else
                {
                    str5 = str5 + str9;
                }
            }
            string str8 = "";
            str8 = "<table   borderColor='#cccccc' cellSpacing='0' borderColorDark='#cccccc' cellPadding='0' width='100%' align='center' border='1' style='border-style:Solid;'>";
            str8 = str8 + "<tr height='30'><td align='left' bgcolor='#5AA6E4'>";
            this.method_1();
            if (!(str5.Trim() != ""))
            {
                base.Response.Write(@"<script>alert('在练习题库中，暂没有找到满足您选择条件的试题\n\n请重新选择条件或清除练习记录！');window.close();</script>");
            }
            else
            {
                str5 = str5.Substring(0, str5.Length - 1);
                if (this.string_2.Trim() == "A")
                {
                    this.labATitle.Visible = true;
                    this.labATitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labATitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:选择一项正确的答案)</font></td></tr></table><br>";
                    this.method_4(str5);
                }
                if (this.string_2.Trim() == "B")
                {
                    this.labBTitle.Visible = true;
                    this.labBTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labBTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:选择多项正确的答案)</font></td></tr></table><br>";
                    this.method_5(str5);
                }
                if (this.string_2.Trim() == "C")
                {
                    this.labCTitle.Visible = true;
                    this.labCTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labCTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:选择一项正确的答案)</font></td></tr></table><br>";
                    this.method_6(str5);
                }
                if (this.string_2.Trim() == "D")
                {
                    this.labDTitle.Visible = true;
                    this.labDTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labDTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:每答对一空都可得分)</font></td></tr></table><br>";
                    this.method_7(str5);
                }
                if (this.string_2.Trim() == "E")
                {
                    this.labETitle.Visible = true;
                    this.labETitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labETitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_8(str5);
                }
                if (this.string_2.Trim() == "F")
                {
                    this.labFTitle.Visible = true;
                    this.labFTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labFTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_8(str5);
                }
                if (this.string_2.Trim() == "G")
                {
                    this.labGTitle.Visible = true;
                    this.labGTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labGTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_8(str5);
                }
                if (this.string_2.Trim() == "H")
                {
                    this.labHTitle.Visible = true;
                    this.labHTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labHTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_8(str5);
                }
                if (this.string_2.Trim() == "J")
                {
                    this.labJTitle.Visible = true;
                    this.labJTitle.Text = str8 + "<font color='#ffffff'><a name='RubricTypeA'></a>&nbsp;&nbsp;<b>一、" + this.labJTitle.Text + "</b>&nbsp;&nbsp;&nbsp;&nbsp;(说明:回答主题正确均可得分)</font></td></tr></table><br>";
                    this.method_9(str5);
                }
            }
        }

        private string method_3()
        {
            string str = "0,0";
            string cmdText = "";
            switch (this.string_2.Trim())
            {
                case "A":
                    cmdText = string.Concat(new object[] { "select RubricCountNS as RubricN,RubricCountYS as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "B":
                    cmdText = string.Concat(new object[] { "select RubricCountND as RubricN,RubricCountYD as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "C":
                    cmdText = string.Concat(new object[] { "select RubricCountNB as RubricN,RubricCountYB as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "D":
                    cmdText = string.Concat(new object[] { "select RubricCountNF as RubricN,RubricCountYF as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "E":
                    cmdText = string.Concat(new object[] { "select RubricCountNA as RubricN,RubricCountYA as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "F":
                    cmdText = string.Concat(new object[] { "select RubricCountNC as RubricN,RubricCountYC as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "G":
                    cmdText = string.Concat(new object[] { "select RubricCountNT as RubricN,RubricCountYT as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "H":
                    cmdText = string.Concat(new object[] { "select RubricCountNAN as RubricN,RubricCountYAN as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                case "J":
                    cmdText = string.Concat(new object[] { "select RubricCountNJ as RubricN,RubricCountYJ as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;

                default:
                    cmdText = string.Concat(new object[] { "select RubricCountNS as RubricN,RubricCountYS as RubricY from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " });
                    break;
            }
            if (!(cmdText.Trim() != ""))
            {
                return str;
            }
            string str5 = "";
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand(cmdText, connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            if (reader.Read())
            {
                str5 = reader["RubricN"].ToString() + reader["RubricY"].ToString();
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
            if (str5.Trim() != "")
            {
                str5 = str5.Substring(0, str5.Length - 1);
            }
            else
            {
                str5 = "0,0";
            }
            return str5;
        }

        private void method_4(string string_7)
        {
            this.DataGridA.Visible = true;
            int num = 0;
            string selectCommandText = "Select top " + this.ViewState["NCount"].ToString() + " ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_7 + ")";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "SRubric");
            this.DataGridA.DataSource = dataSet.Tables["SRubric"].DefaultView;
            this.DataGridA.DataBind();
            for (int i = 0; i < this.DataGridA.Rows.Count; i++)
            {
                string[] strArray2 = dataSet.Tables["SRubric"].Rows[i]["OptionAnswer"].ToString().Replace("&nbsp;", "").Replace("<BR>", "").Split(new char[] { '#' });
                Label label4 = (Label) this.DataGridA.Rows[i].FindControl("labADataTitle");
                RadioButtonList list = (RadioButtonList) this.DataGridA.Rows[i].FindControl("RBLAData");
                num++;
                label4.Text = num.ToString() + "、<a name='" + num.ToString() + "'></a>" + label4.Text.ToString();
                if (strArray2[0].Trim() != "")
                {
                    strArray2[0] = "A、" + strArray2[0].Replace("＃", "#");
                    ListItem item6 = new ListItem(strArray2[0].Replace("＃", "#"), "A");
                    list.Items.Insert(0, item6);
                }
                if (strArray2[1].Trim() != "")
                {
                    strArray2[1] = "B、" + strArray2[1].Replace("＃", "#");
                    ListItem item5 = new ListItem(strArray2[1].Replace("＃", "#"), "B");
                    list.Items.Insert(1, item5);
                }
                if (strArray2[2].Trim() != "")
                {
                    strArray2[2] = "C、" + strArray2[2].Replace("＃", "#");
                    ListItem item4 = new ListItem(strArray2[2].Replace("＃", "#"), "C");
                    list.Items.Insert(2, item4);
                }
                if (strArray2[3].Trim() != "")
                {
                    strArray2[3] = "D、" + strArray2[3].Replace("＃", "#");
                    ListItem item3 = new ListItem(strArray2[3].Replace("＃", "#"), "D");
                    list.Items.Insert(3, item3);
                }
                if (strArray2[4].Trim() != "")
                {
                    strArray2[4] = "E、" + strArray2[4].Replace("＃", "#");
                    ListItem item2 = new ListItem(strArray2[4].Replace("＃", "#"), "E");
                    list.Items.Insert(4, item2);
                }
                if (strArray2[5].Trim() != "")
                {
                    strArray2[5] = "F、" + strArray2[5].Replace("＃", "#");
                    ListItem item = new ListItem(strArray2[5].Replace("＃", "#"), "F");
                    list.Items.Insert(5, item);
                }
                if (this.string_6.Trim() == "N")
                {
                    Label label3 = (Label) this.DataGridA.Rows[i].FindControl("labAOKAnswer");
                    Label label2 = (Label) this.DataGridA.Rows[i].FindControl("labAOKMemo");
                    label3.Text = label3.Text.Replace("<BR>", "").Replace("<br>", "").Replace("&nbsp;", "").ToUpper();
                    Label label = (Label) this.DataGridA.Rows[i].FindControl("labAOKAnswerTip");
                    if (label3.Text.Trim() != "")
                    {
                        label.Text = "<br><a href='#" + num.ToString() + "' onclick=javascript:alert('正确答案为：" + label3.Text + "')><font color=red>查看答案</font></a>";
                    }
                    if (label2.Text.Trim() != "")
                    {
                        label.Text = label.Text + "&nbsp;&nbsp;<a href='#" + num.ToString() + "' onclick=javascript:alert('正确解析为：" + label2.Text + "')><font color=red>查看解析</font></a>";
                    }
                    label.Visible = true;
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_5(string string_7)
        {
            this.DataGridB.Visible = true;
            int num = 0;
            string selectCommandText = "Select top " + this.ViewState["NCount"].ToString() + "  ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_7 + ")";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "BRubric");
            this.DataGridB.DataSource = dataSet.Tables["BRubric"].DefaultView;
            this.DataGridB.DataBind();
            for (int i = 0; i < this.DataGridB.Rows.Count; i++)
            {
                string[] strArray2 = dataSet.Tables["BRubric"].Rows[i]["OptionAnswer"].ToString().Replace("&nbsp;", "").Replace("<BR>", "").Split(new char[] { '#' });
                Label label4 = (Label) this.DataGridB.Rows[i].FindControl("labBDataTitle");
                CheckBoxList list = (CheckBoxList) this.DataGridB.Rows[i].FindControl("CBLBData");
                if (strArray2[0].Trim() != "")
                {
                    strArray2[0] = "A、" + strArray2[0].Replace("＃", "#");
                    list.Items.Add(strArray2[0].Replace("＃", "#"));
                }
                if (strArray2[1].Trim() != "")
                {
                    strArray2[1] = "B、" + strArray2[1].Replace("＃", "#");
                    list.Items.Add(strArray2[1].Replace("＃", "#"));
                }
                if (strArray2[2].Trim() != "")
                {
                    strArray2[2] = "C、" + strArray2[2].Replace("＃", "#");
                    list.Items.Add(strArray2[2].Replace("＃", "#"));
                }
                if (strArray2[3].Trim() != "")
                {
                    strArray2[3] = "D、" + strArray2[3].Replace("＃", "#");
                    list.Items.Add(strArray2[3].Replace("＃", "#"));
                }
                if (strArray2[4].Trim() != "")
                {
                    strArray2[4] = "E、" + strArray2[4].Replace("＃", "#");
                    list.Items.Add(strArray2[4].Replace("＃", "#"));
                }
                if (strArray2[5].Trim() != "")
                {
                    strArray2[5] = "F、" + strArray2[5].Replace("＃", "#");
                    list.Items.Add(strArray2[5].Replace("＃", "#"));
                }
                num++;
                label4.Text = num.ToString() + "、<a name='" + num.ToString() + "'></a>" + label4.Text.ToString();
                if (this.string_6.Trim() == "N")
                {
                    Label label3 = (Label) this.DataGridB.Rows[i].FindControl("labBOKAnswer");
                    Label label2 = (Label) this.DataGridB.Rows[i].FindControl("labBOKMemo");
                    label3.Text = label3.Text.Replace("<BR>", "").Replace("<br>", "").Replace("&nbsp;", "").ToUpper();
                    Label label = (Label) this.DataGridB.Rows[i].FindControl("labBOKAnswerTip");
                    if (label3.Text.Trim() != "")
                    {
                        label.Text = "<br><a href='#" + num.ToString() + "' onclick=javascript:alert('正确答案为：" + label3.Text.Replace("#", "、") + "')><font color=red>查看答案</font></a>";
                    }
                    if (label2.Text.Trim() != "")
                    {
                        label.Text = label.Text + "&nbsp;&nbsp;<a href='#" + num.ToString() + "' onclick=javascript:alert('正确解析为：" + label2.Text + "')><font color=red>查看解析</font></a>";
                    }
                    label.Visible = true;
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_6(string string_7)
        {
            this.DataGridC.Visible = true;
            int num = 0;
            string selectCommandText = "Select top " + this.ViewState["NCount"].ToString() + "  ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_7 + ")";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "CRubric");
            this.DataGridC.DataSource = dataSet.Tables["CRubric"].DefaultView;
            this.DataGridC.DataBind();
            for (int i = 0; i < this.DataGridC.Rows.Count; i++)
            {
                dataSet.Tables["CRubric"].Rows[i]["OptionAnswer"].ToString().Split(new char[] { '#' });
                Label label4 = (Label) this.DataGridC.Rows[i].FindControl("labCDataTitle");
                RadioButtonList list1 = (RadioButtonList) this.DataGridC.Rows[i].FindControl("RBLCData");
                num++;
                label4.Text = num.ToString() + "、<a name='" + num.ToString() + "'></a>" + label4.Text.ToString();
                if (this.string_6.Trim() == "N")
                {
                    Label label2 = (Label) this.DataGridC.Rows[i].FindControl("labCOKMemo");
                    Label label3 = (Label) this.DataGridC.Rows[i].FindControl("labCOKAnswer");
                    Label label = (Label) this.DataGridC.Rows[i].FindControl("labCOKAnswerTip");
                    if (label3.Text.Trim() != "")
                    {
                        label.Text = "<br><a href='#" + num.ToString() + "' onclick=javascript:alert('正确答案为：" + label3.Text.Replace("Y", "正确").Replace("N", "错误") + "')><font color=red>查看答案</font></a>";
                    }
                    if (label2.Text.Trim() != "")
                    {
                        label.Text = label.Text + "&nbsp;&nbsp;<a href='#" + num.ToString() + "' onclick=javascript:alert('正确解析为：" + label2.Text + "')><font color=red>查看解析</font></a>";
                    }
                    label.Visible = true;
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_7(string string_7)
        {
            try
            {
                this.DataGridD.Visible = true;
                int num = 0;
                string selectCommandText = "Select  top " + this.ViewState["NCount"].ToString() + " ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo from RubricInfo where ID in(" + string_7 + ")";
                SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
                DataSet dataSet = new DataSet();
                adapter.Fill(dataSet, "FRubric");
                this.DataGridD.DataSource = dataSet.Tables["FRubric"].DefaultView;
                this.DataGridD.DataBind();
                for (int i = 0; i < this.DataGridD.Rows.Count; i++)
                {
                    num++;
                    Label label1 = (Label) this.DataGridD.Rows[i].FindControl("labDOKAnswer");
                    Label label = (Label) this.DataGridD.Rows[i].FindControl("labDDataTitle");
                    TextBox box = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerA");
                    TextBox box2 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerB");
                    TextBox box3 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerC");
                    TextBox box4 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerD");
                    TextBox box5 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerE");
                    TextBox box6 = (TextBox) this.DataGridD.Rows[i].FindControl("txtDAnswerF");
                    Label label3 = (Label) this.DataGridD.Rows[i].FindControl("labDFileName");
                    Label label4 = (Label) this.DataGridD.Rows[i].FindControl("labDVodFile");
                    switch (label.Text.ToString().Replace("___", "＃").Split(new char[] { '＃' }).Length)
                    {
                        case 1:
                            box.Visible = false;
                            box2.Visible = false;
                            box3.Visible = false;
                            box4.Visible = false;
                            box5.Visible = false;
                            box6.Visible = false;
                            break;

                        case 2:
                            box.Visible = true;
                            box2.Visible = false;
                            box3.Visible = false;
                            box4.Visible = false;
                            box5.Visible = false;
                            box6.Visible = false;
                            break;

                        case 3:
                            box.Visible = true;
                            box2.Visible = true;
                            box3.Visible = false;
                            box4.Visible = false;
                            box5.Visible = false;
                            box6.Visible = false;
                            break;

                        case 4:
                            box.Visible = true;
                            box2.Visible = true;
                            box3.Visible = true;
                            box4.Visible = false;
                            box5.Visible = false;
                            box6.Visible = false;
                            break;

                        case 5:
                            box.Visible = true;
                            box2.Visible = true;
                            box3.Visible = true;
                            box4.Visible = true;
                            box5.Visible = false;
                            box6.Visible = false;
                            break;

                        case 6:
                            box.Visible = true;
                            box2.Visible = true;
                            box3.Visible = true;
                            box4.Visible = true;
                            box5.Visible = true;
                            box6.Visible = false;
                            break;

                        case 7:
                            box.Visible = true;
                            box2.Visible = true;
                            box3.Visible = true;
                            box4.Visible = true;
                            box5.Visible = true;
                            box6.Visible = true;
                            break;
                    }
                    box.Attributes.Add("onpaste", "return false");
                    box2.Attributes.Add("onpaste", "return false");
                    box3.Attributes.Add("onpaste", "return false");
                    box4.Attributes.Add("onpaste", "return false");
                    box5.Attributes.Add("onpaste", "return false");
                    box6.Attributes.Add("onpaste", "return false");
                    label.Text = num.ToString() + "、" + label.Text.ToString() + "<a name='D" + i.ToString() + "'></a>";
                }
                adapter.Dispose();
                dataSet.Clear();
                dataSet.Dispose();
                selectConnection.Close();
                selectConnection.Dispose();
            }
            catch
            {
                base.Response.Write("<script>alert('试卷显示不齐全，填空题有错误格式的试题！');</script>");
            }
        }

        private void method_8(string string_7)
        {
            this.DataGridE.Visible = true;
            int num = 0;
            string selectCommandText = "Select  top " + this.ViewState["NCount"].ToString() + " ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo  from RubricInfo  where ID in(" + string_7 + ")";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "ARubric");
            this.DataGridE.DataSource = dataSet.Tables["ARubric"].DefaultView;
            this.DataGridE.DataBind();
            for (int i = 0; i < this.DataGridE.Rows.Count; i++)
            {
                num++;
                Label label1 = (Label) this.DataGridE.Rows[i].FindControl("labEOKAnswer");
                Label label = (Label) this.DataGridE.Rows[i].FindControl("labEDataTitle");
                label.Text = num.ToString() + "、" + label.Text.ToString() + "<a name='E" + i.ToString() + "'></a>";
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_9(string string_7)
        {
            this.DataGridJ.Visible = true;
            int num = 0;
            string selectCommandText = "Select  top " + this.ViewState["NCount"].ToString() + " ID,SubjectID,RubricType,RubricTitle,OptionAnswer,OKAnswer,OKMemo  from RubricInfo   where ID in(" + string_7 + ")";
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "JRubric");
            this.DataGridJ.DataSource = dataSet.Tables["JRubric"].DefaultView;
            this.DataGridJ.DataBind();
            for (int i = 0; i < this.DataGridJ.Rows.Count; i++)
            {
                num++;
                Label label1 = (Label) this.DataGridJ.Rows[i].FindControl("labJOKAnswer");
                Label label = (Label) this.DataGridJ.Rows[i].FindControl("labJDataTitle");
                label.Text = num.ToString() + "、" + label.Text.ToString() + "<a name='J" + i.ToString() + "'></a>";
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            if ((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false)
            {
                base.Response.Expires = 0;
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                this.int_1 = Convert.ToInt32(base.Request["SubjectID"].ToString());
                this.string_2 = base.Request["RubricType"].ToString();
                this.string_3 = base.Server.UrlDecode(base.Request["SubjectName"].ToString()).Replace("│", "").Replace("├", "");
                this.string_4 = base.Request["RubricDiff"].ToString();
                this.string_5 = base.Request["StudyType"].ToString();
                this.Page.Title = ConfigurationManager.ConnectionStrings["ProTitle"].ConnectionString + "在线练习";
                if (!base.IsPostBack)
                {
                    if (!(this.publicFun_0.ReturnPaperData() != "Yes"))
                    {
                        this.ViewState["CheckExamFen"] = "0";
                        this.string_6 = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='IsStudyLookOK'", "ParmValue").Trim();
                        this.labUserInfo.Text = "练习科目：" + this.string_3;
                        this.ViewState["LastWriteN"] = "";
                        this.ViewState["UserWriteN"] = "";
                        this.method_0();
                        this.method_2();
                    }
                    else
                    {
                        base.Response.Write("<script>alert('此版本暂未授权,请联系管理员！')</script>");
                    }
                }
                else
                {
                    try
                    {
                        if (this.DataGridA.Visible)
                        {
                            this.method_10();
                            if (this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != "")
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYS='", this.labWriteSY.Text, this.string_1, "',RubricNS='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYS='", this.labCountWriteSY.Text, this.string_1, "',RubricCountNS='", this.ViewState["CountNS"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYS,RubricYD,RubricYB,RubricNS,RubricNB,RubricND,RubricCountYS,RubricCountYD,RubricCountYB,RubricCountNS,RubricCountND,RubricCountNB) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','','','", this.string_0, "','','','", this.string_1, "','','','", this.string_0, "','','')" }));
                            }
                        }
                        if (this.DataGridB.Visible)
                        {
                            this.method_11();
                            if (this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != "")
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYD='", this.labWriteDY.Text, this.string_1, "',RubricND='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYD='", this.labCountWriteDY.Text, this.string_1, "',RubricCountND='", this.ViewState["CountND"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYS,RubricYD,RubricYB,RubricNS,RubricND,RubricNB,RubricCountYS,RubricCountYD,RubricCountYB,RubricCountNS,RubricCountND,RubricCountNB) values('", this.httpCookie_0.Value, "',", this.int_1, ",'','", this.string_1, "','','','", this.string_0, "','','','", this.string_1, "','','','", this.string_0, "','')" }));
                            }
                        }
                        if (this.DataGridC.Visible)
                        {
                            this.method_12();
                            if (!(this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != ""))
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYS,RubricYD,RubricYB,RubricNS,RubricND,RubricNB,RubricCountYS,RubricCountYD,RubricCountYB,RubricCountNS,RubricCountND,RubricCountNB) values('", this.httpCookie_0.Value, "',", this.int_1, ",'','','", this.string_1, "','','','", this.string_0, "','','','", this.string_1, "','','','", this.string_0, "')" }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYB='", this.labWriteBY.Text, this.string_1, "',RubricNB='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYB='", this.labCountWriteBY.Text, this.string_1, "',RubricCountNB='", this.ViewState["CountNB"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                        }
                        if (this.DataGridD.Visible)
                        {
                            this.method_13();
                            if (!(this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != ""))
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYF,RubricNF,RubricCountYF,RubricCountNF) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','", this.string_0, "','", this.string_1, "','", this.string_0, "')" }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYF='", this.labWriteFY.Text, this.string_1, "',RubricNF='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYF='", this.labCountWriteFY.Text, this.string_1, "',RubricCountNF='", this.ViewState["CountNF"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                        }
                        if (!(this.DataGridE.Visible ? !this.labETitle.Visible : true))
                        {
                            this.method_14();
                            if (this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != "")
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYA='", this.labWriteAY.Text, this.string_1, "',RubricNA='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYA='", this.labCountWriteAY.Text, this.string_1, "',RubricCountNA='", this.ViewState["CountNA"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYA,RubricNA,RubricCountYA,RubricCountNA) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','", this.string_0, "','", this.string_1, "','", this.string_0, "')" }));
                            }
                        }
                        if (this.labFTitle.Visible)
                        {
                            this.method_14();
                            if (this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != "")
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYC='", this.labWriteCY.Text, this.string_1, "',RubricNC='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYC='", this.labCountWriteCY.Text, this.string_1, "',RubricCountNC='", this.ViewState["CountNC"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYC,RubricNC,RubricCountYC,RubricCountNC) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','", this.string_0, "','", this.string_1, "','", this.string_0, "')" }));
                            }
                        }
                        if (this.labGTitle.Visible)
                        {
                            this.method_14();
                            if (this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != "")
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYT='", this.labWriteTY.Text, this.string_1, "',RubricNT='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYT='", this.labCountWriteTY.Text, this.string_1, "',RubricCountNT='", this.ViewState["CountNT"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYT,RubricNT,RubricCountYT,RubricCountNT) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','", this.string_0, "','", this.string_1, "','", this.string_0, "')" }));
                            }
                        }
                        if (this.labHTitle.Visible)
                        {
                            this.method_14();
                            if (!(this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != ""))
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYAN,RubricNAN,RubricCountYAN,RubricCountNAN) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','", this.string_0, "','", this.string_1, "','", this.string_0, "')" }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYAN='", this.labWriteANY.Text, this.string_1, "',RubricNAN='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYAN='", this.labCountWriteANY.Text, this.string_1, "',RubricCountNAN='", this.ViewState["CountNAN"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                        }
                        if (this.DataGridJ.Visible)
                        {
                            this.method_15();
                            if (!(this.publicFun_0.GetValues(string.Concat(new object[] { "select UserCode from StudyHistory where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, " " }), "UserCode") != ""))
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { "insert into StudyHistory(UserCode,SubjectID,RubricYJ,RubricNJ,RubricCountYJ,RubricCountNJ) values('", this.httpCookie_0.Value, "',", this.int_1, ",'", this.string_1, "','", this.string_0, "','", this.string_1, "','", this.string_0, "')" }));
                            }
                            else
                            {
                                this.publicFun_0.ExecuteSql(string.Concat(new object[] { 
                                    "update StudyHistory set RubricYJ='", this.labWriteJY.Text, this.string_1, "',RubricNJ='", this.ViewState["LastWriteN"].ToString(), this.string_0, "',RubricCountYJ='", this.labCountWriteJY.Text, this.string_1, "',RubricCountNJ='", this.ViewState["CountNJ"].ToString(), this.string_0, "' where UserCode='", this.httpCookie_0.Value, "' and SubjectID=", this.int_1, 
                                    " "
                                 }));
                            }
                        }
                    }
                    catch
                    {
                    }
                    if (this.txtHideComm.Value.Trim() == "CheckExam")
                    {
                        string str5 = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='RightStudy'", "ParmValue").Trim();
                        if (str5.Trim() == "")
                        {
                            str5 = "8";
                        }
                        if (this.int_0 >= Convert.ToInt16(str5))
                        {
                            string str4 = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='StudyFen'", "ParmValue").Trim();
                            if (str4.Trim() == "")
                            {
                                str4 = "1";
                            }
                            if (this.ViewState["CheckExamFen"].ToString() != "1")
                            {
                                this.publicFun_0.ExecuteSql("insert into UserStudyFen(UserCode,ExamStudyName,StudyFen,Formtable,FormID,ExamOrStudy) values('" + this.httpCookie_0.Value + "','" + this.labUserInfo.Text + "','" + str4 + "','JoinStudy','0','L')");
                                this.ViewState["CheckExamFen"] = "1";
                            }
                        }
                    }
                    if (this.txtHideComm.Value.Trim() == "EndExam")
                    {
                        string str = this.string_1;
                        string str2 = this.string_0;
                        string str3 = base.Request.Url.ToString();
                        str3 = str3.Substring(0, str3.LastIndexOf('/') + 1);
                        base.Response.Redirect(string.Concat(new object[] { str3, "FrmSetNextTask.aspx?SubjectName=", base.Server.UrlEncode(this.string_3), "&SubjectID=", this.int_1, "&RubricType=", this.string_2, "&WriteY=", str, "&WriteN=", str2 }));
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

